let spans = document.querySelectorAll('.main-b-l span')
console.log(spans);

let over = new Date('2021-2-6 0:0:0');

let time = setInterval(function() {
        let current = new Date()
        let miao = parseInt(over - current) / 1000;
        let m = parseInt(miao % 60);
        let f = parseInt((miao / 60) % 60);
        let s = parseInt(miao / 60 / 60);
        if (m < 10) {
            m = "0" + m;
        }
        if (f < 10) {
            f = "0" + f;
        }
        if (s < 10) {
            s = "0" + s;
        }
        spans.forEach((v, i) => {
            spans[0].innerHTML = s;
            spans[1].innerHTML = f
            spans[2].innerHTML = m
        })
    })
    // 添加商品
let pagenum = 0;
let pagesize = 8;
let uid = localStorage.getItem("uid");
console.log(uid);
let list = document.querySelector("#list1");
console.log(list);
listgoods();
async function listgoods() {
    let params = {
        uid,
        pagenum,
        pagesize,
    };

    try {
        let {
            data
        } = await axios.get(listAPI, {
            params,
        });
        console.log(data);
        let arr = data.data.map(
            (v) => `
            
             <li>
             <a href='details.html?pid=${v.pid}'>
                <img src="${v.pimg}" alt="" />
                <h3>${v.pname}</h3>
                <p>${v.pdesc}</p>
                <span>${v.pprice}</span>
             </li>
             </a>
      `
        );

        list.innerHTML += arr.join("");
        // 页面才有了删除按钮
        delgoods();
    } catch (error) {}
}